<?php

namespace App\Services\MakeGoldChargeOrder;

use App\Models\User;

class MakeGoldChargeOrder
{
	/**
	 * @var User
	 */
	protected $user;
	
	protected $amount = 0;
	
	public function __construct(User $user, $amount)
	{
		$this->user = $user;
		$this->amount = $amount;
	}
	
	protected function charge()
	{
		return $this->user->goldCharges()->create(['total_amount' => $this->amount]);
	}
	
	public function make()
	{
		return $this->charge();
	}
}
